package com.leonzx.base;

import com.leonzx.base.utils.SpringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ApplicationContext;
import tk.mybatis.spring.annotation.MapperScan;

/**
 * 禁用Srping-Boot 自带的读取datasource的类
 */
@SpringBootApplication(exclude = {
        DataSourceAutoConfiguration.class
})
@MapperScan(basePackages = "com.leonzx.base.dao")
public class Application {
    public static final Logger logger = LoggerFactory.getLogger(Application.class);

    public static void main(String[] args) {
        ApplicationContext applicationContext = SpringApplication.run(Application.class, args);
        SpringUtils.applicationContext = applicationContext;
        logger.info("Springboot Application [leon-base] started!");
    }
}